//
//  UIGesture+Extension.swift
//  joyBao
//
//  Created by Chen on 2017/8/31.
//  Copyright © 2017年 Chen. All rights reserved.
//

import Foundation
import RxSwift
import RxCocoa

extension UIGestureRecognizer {

    func gestureDidCallback(_ callback: @escaping (_ gesture: UIGestureRecognizer) -> ()) {
        self.rx.event.subscribe({ (event: Event) in
            switch event {
            case .next(let gesture):
                callback(gesture)
                break
            default:
                break
            }
        }).addDisposableTo(bag)
    }

}
